package com.scalar.chiptrack.operations.dataentry.forms;

import com.scalar.chiptrack.ChipTrackActionForm;
import com.scalar.chiptrack.operations.discrepancyLotsNotifications.DiscrepancyLot;
import com.scalar.chiptrack.operations.dataentry.DataEntryLot;
import com.scalar.chiptrack.utils.AutoGrowingArrayList;

import java.util.ArrayList;

import org.apache.struts.action.ActionMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by IntelliJ IDEA.
 * User: munugoti
 * Date: 24 Aug, 2009
 * Time: 12:37:55 PM
 * To change this template use File | Settings | File Templates.
 */
public class DataEntryLotsForm extends ChipTrackActionForm
{
    private String vendorName;
    private String psType;
    private AutoGrowingArrayList dataEntryLots = new AutoGrowingArrayList(DataEntryLot.class);
    private ArrayList confirmDataEntryLots = new AutoGrowingArrayList(DataEntryLot.class);


    public String getVendorName() {
        return vendorName;
    }

    public void setVendorName(String vendorName) {
        this.vendorName = vendorName;
    }

    public String getPsType() {
        return psType;
    }

    public void setPsType(String psType) {
        this.psType = psType;
    }

    public AutoGrowingArrayList getDataEntryLots() {
        return dataEntryLots;
    }

    public void setDataEntryLots(AutoGrowingArrayList dataEntryLots) {
        this.dataEntryLots = dataEntryLots;
    }

    public ArrayList getConfirmDataEntryLots() {
        return confirmDataEntryLots;
    }

    public void setConfirmDataEntryLots(ArrayList confirmDataEntryLots) {
        this.confirmDataEntryLots = confirmDataEntryLots;
    }

    public void reset(ActionMapping actionMapping, HttpServletRequest httpServletRequest)
    {
        int discrepancyListSize = ( dataEntryLots == null ) ? 0 : dataEntryLots.size();
        DataEntryLot dataEntryLot = null;
        for ( int i = 0; i < discrepancyListSize; i++ )
        {
            dataEntryLot = (DataEntryLot)dataEntryLots.get( i );
            dataEntryLot.setSelected( false );
        }
    }
}
